import request from '@/router/axios';

/**
 * 生成原材料包装条码
 */
export const createSequence = (row) => {
  return request({
    url: '/api/mes-warehouse/flow/execute',
    method: 'post',
    data: row
  });
};
/**
 * 历史物料标签 生成
 */
export const historycreate = (row) => {
  return request({
    url: '/api/mes-warehouse/packing/generation/history/create',
    method: 'post',
    data: row
  });
};
/**
 * 历史物料标签 生成
 */
export const historyPrint = (row) => {
  return request({
    url: '/api/mes-warehouse/packing/generation/history/print',
    method: 'post',
    data: row
  });
};

/**
 * 打印条码
 */
export const printSequence = (row) => {
  return request({
    url: '/api/mes-warehouse/packing/generation/pack/print',
    method: 'post',
    data: row
  });
};

/**
 * 根据原材料收料记录id查询生成记录
 */
export const getSourceList = (params) => {
  return request({
    url: '/api/mes-admin/sequence/generation/source',
    method: 'get',
    params: params
  });
};

/**
 * 重打条码
 */
export const packPrint = (data) => {
  return request({
    url: '/api/mes-warehouse/packing/generation/duplicate-print',
    method: 'post',
    data: data
  });
};

// 打印测试
export const printTest = (row) => {
  return request({
    url: '/api/mes-warehouse/packing/generation/permutation',
    method: 'post',
    params: { ...row }
  });
};
